package file.day9_18.day03;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String name = "周杰伦",gender = "男";
        int age = 49;
        String[] otherInfo = {"歌坛之王，跨世纪，他就是Jay"};
        Person person = new Person(name,gender,age,otherInfo);

        FileOutputStream fos = new FileOutputStream("person.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);

        oos.writeObject(person);//对象序列化:将一个java对象按照其结构转换为一组字节的过程
        System.out.println("写出完毕");

        oos.close();
    }
}
